import React, { useRef } from 'react';
import Generator from 'fr-generator';
import { GeneratorProps } from '../type';

const GC: React.FC<GeneratorProps> = ({ onSchemaChange, editClick, genreatorProps, ...props }) => {
  const ref = useRef();
  return (
    <Generator
      ref={ref}
      {...genreatorProps}
      // defaultValue={schemaData.schema ? schemaData.schema : null}
      extraButtons={
        [
          // {
          //   text: '去编辑数据源',
          //   onClick: () => editClick(),
          // },
        ]
      }
      onSchemaChange={(schema: any) => onSchemaChange(schema)}
    />
  );
};

export default GC;
